<?php
if(!isset($GLOBALS['_vars'])) $GLOBALS['_vars'] = array(); 
$fields = array();
?><!DOCTYPE html>
<html>
<head>
<meta charset="<?php echo $cfg_soft_lang; ?>">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>SVIP会员订单管理</title>
<link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
<link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
<link rel="stylesheet" href="../static/web/css/admin.css">
<script>
    //获得选中项
    function getCheckboxItem() {
      var allSel = "";
      if (document.form1.aids.value) return document.form1.aids.value;
      for (i = 0; i < document.form1.aids.length; i++) {
        if (document.form1.aids[i].checked) {
          if (allSel == "")
            allSel = document.form1.aids[i].value;
          else
            allSel = allSel + "`" + document.form1.aids[i].value;
        }
      }
      return allSel;
    }
    function ReSel() {
      for (i = 0; i < document.form1.aids.length; i++) {
        if (document.form1.aids[i].checked) document.form1.aids[i].checked = false;
        else document.form1.aids[i].checked = true;
      }
    }
    function DelSel() {
      var nid = getCheckboxItem();
      if (nid == "") {
        alert("请选择要删除的订单");
        return;
      }
      location.href = "member_do.php?dopost=deoperations&nid=" + nid;
    }
    function UpSel() {
      var nid = getCheckboxItem();
      if (nid == "") {
        alert("请选择要更改的订单");
        return;
      }
      location.href = "member_do.php?dopost=upoperations&nid=" + nid;
    }
    function OkSel() {
      var nid = getCheckboxItem();
      if (nid == "") {
        alert("请选择要修改的订单");
        return;
      }
      location.href = "member_do.php?dopost=okoperations&nid=" + nid;
    }
</script>
</head>
<style type="text/css">
.coolbg{padding:0 15px !important;height:24px !important;line-height:24px !important;}
.coolbg:hover{background:#333;color:#fff;}
.col-md-9{max-width:98%;overflow:hidden;margin:15px;padding:0;flex: 0 0 98%;}
.finance_condition_wrapper{float:left;width:58%;border:1px solid #cfcfcf;}
.finance_condition_wrapper .finance_condition_header{height:50px;background:#692020;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;}
.finance_condition_wrapper .finance_condition_header span{font-size:14px;color:#fff;width:30%;text-align:center;}
.finance_condition_wrapper .finance_condition_header span:last-child{border-right:none;-ms-flex:1;flex:1;}
.finance_condition_wrapper .finance_condition_content{display:-ms-flexbox;display:flex;height:100px;-ms-flex-align:center;align-items:center;box-sizing:border-box;background:#fff;}
.finance_condition_wrapper .finance_condition_content span{line-height:36px;height:36px;font-size:36px;border-right:1px solid #cfcfcf;width:30%;text-align:center;}
.finance_condition_wrapper .finance_condition_content span:last-child{border-right:none;-ms-flex:1;flex:1;}

.pagelistbox{text-align:center;padding-top:30px;padding-bottom:30px;overflow:hidden;}
.pagelistbox a{background-color:#fff;font-size:14px;display:inline-block;height:36px;line-height:36px;border:1px solid #dadada;color:#666;margin-left:5px;padding:0 20px;}
.pagelistbox a:hover{border:1px solid #ff700a;color:#fff;background-color:#ff700a;text-decoration:none;}
.pagelistbox .cpage{font-size:14px;display:inline-block;height:36px;line-height:36px;border:1px solid #ff700a;color:#fff;background-color:#ff700a;margin-left:5px;padding:0 20px;}
</style>
</head>
<body>

<!-- 订单搜索 -->
<form name="form2" method="get" action="member_operations.php">
<table width="98%" cellpadding="1" cellspacing="1" align="center" class="mt-3 mb-3" style="display:none;">
<tr>
<td height="36">
<table cellpadding="0" cellspacing="0">
<tr>
<td width="260" align="center"><input name="buyid" type="text" id="buyid" placeholder="输入订单号" style="width:260px;margin-right:10px;height:40px;line-height:40px;"></td>
<td><button type="submit" class="btn btn-success btn-sm" style="height:40px;line-height:40px;padding:0 10px;font-size:14px;">搜索</button></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<!-- 订单搜索 End -->


<table width="98%" cellpadding="1" cellspacing="1" align="center" class="table maintable mb-3">

<!-- VIP会员金额统计 -->
<div class="col-md-9">

<!-- 本月统计 -->
<div class="finance_condition_wrapper" style="margin-right:22px;">
<div class="finance_condition_header"><span style="border-right:1px solid rgb(222,226,230);;">本月会员总收入(元)</span><span style="border-right:1px solid #e8e8e8;">本月会员购买人数</span><span>历史累计总收入(元)</span></div>
<div class="finance_condition_content"><span><?php echo $GLOBALS['allm']; ?></span><span><?php echo $GLOBALS['nowc']; ?></span><span><?php echo $GLOBALS['all_m']; ?></span></div>
</div>

<!-- 上个月统计 -->
<div class="finance_condition_wrapper" style="width:40%;">
<div class="finance_condition_header" style="background:#403e3e;"><span style="width:40%;color:#fff;border-right:1px solid #e8e8e8;">上个月会员购买人数</span><span style="width:40%;color:#fff;">上个月会员总收入(元)</span></div>
<div class="finance_condition_content"><span style="width:40%;"><?php echo $GLOBALS['oldc']; ?></span><span style="width:40%;"><?php echo $GLOBALS['oldm']; ?></span></div>
</div>

</div>
<!-- VIP会员金额统计 End -->

    <tr>
      <td height="26" colspan="8" background="../static/web/img/tbg.gif">
        <table width="98%" cellspacing="0" cellpadding="0" class="table table-borderless">
          <tr>
          <td width="30%" style="padding-left:10px">SVIP订单管理</td>
          <td width="45%" align="right" style="padding-top:10px">
          <button type="button" onClick="location='member_operations.php?sta=0';" class="btn btn-success btn-sm">未付款</button>
          <button type="button" onClick="location='member_operations.php?sta=2';" class="btn btn-success btn-sm">已完成</button>
          </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr bgcolor="#F8FCF1">
      <td width="8%" align="center">选择</td>
      <td width="20%" align="center">订单编号</td>
      <td align="center">商品名称</td>
      <td width="10%" align="center">商品类型</td>
      <td width="22%" align="center">购买时间</td>
      <td width="8%" align="center">订单价格</td>
      <td width="8%" align="center">状态</td>
      <td width="10%" align="center">购买账号</td>
    </tr>
    <form name="form1">
      <?php
$atts = array();
$atts['tagname'] = 'datalist';
$atts['empty'] = '<tr><td colspan="8"><center>暂无内容</center></td></tr>';
$blockValue = $this->refObj->GetArcList($atts,$this->refObj,$fields); 
$total = $this->refObj->totalResult;
if(is_array($blockValue)){
foreach( $blockValue as $key=>$fields )
{
?>
      <tr height="26" align="center" onmousemove="javascript:this.bgColor='#F8FCF1';" onmouseout="javascript:this.bgColor='#ffffff';">
        <td align="center">
        <input type='checkbox' name='aids' value='<?php echo $fields['aid']?>' class='np'></td>
        <td align="center">
        <?php echo $fields['buyid']?>
        </td>
        <td align="center">
        <?php echo $fields['pname'];?>
        </td>
        <td align="center">
        <?php echo GetPType($fields['product'])?>
        </td>
        <td align="center">
        <?php echo GetDateTimeMk($fields['mtime'])?>
        </td>
        <td align="center">
        <?php echo $fields['money']?>
        </td>
        <td align="center">
        <?php echo GetSta($fields['sta'])?>
        </td>
        <td align="center">
        <?php echo GetMemberID($fields['mid'])?>
        </td>
      </tr>
      <?php
}if($total==0 && !empty($atts['empty'])) echo $atts['empty'];
}?>
    </form>
    <tr>
    <td height="26" colspan="8" bgcolor="#FCFDF7" style="padding-top:10px">&nbsp;
    <button type="button" onClick="ReSel();" class="btn btn-success btn-sm">反选</button>
    <button type="button" onClick="DelSel();" class="btn btn-success btn-sm">删除</button>
    </td>
    </tr>
    <tr>
    <td height="36" colspan="8" align="center">
    <div class="pagelistbox" style="background:#fff;">
    <?php
$atts = array();
$atts['tagname'] = 'pagelist';
$atts['listsize'] = '5';
 echo $this->refObj->GetPageList($atts,$this->refObj,$fields); 
?>

    </div>
    </td>
    </tr>
</table>
</body>
</html>